// pages/login/login.js
Page({

  /**
   * 页面的初始数据
   */



  formSubmit(e) {
    var borbookname = e.detail.value.borbookname;
    
    var borname=wx.getStorageSync("uname");
    console.log(borbookname +borname)
    if(!borname){
      wx.showModal({
        title: '提示',
        content: '请登录',
      })
    }else{
      //还书请求
      wx.request({
        url: 'http://localhost:8080/parking/bookhis/bookback',
        data: {
          borname: borname,
          borbookname: borbookname
        },
        success: function (res) {
          var mes = res.data.mess
          if (mes === "成功") {
            wx.showModal({
              title: '提示',
              content: '还书成功',
            })
          } else {
            wx.showModal({
              title: '提示',
              content: '还书失败',
            })
          }

        }
      })
    }
  },




  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }

})